#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>
#include <math.h>

static int i = 1;

int shuixian(int x)
{

	int sum = 0;

	if (x / 10 != 0)
	{
		i++;
		sum = shuixian(x / 10);

	}
	return   sum + pow(x % 10, i);
}


int main()
{
	int j;
	for (j = 100; j < 10000; j++)
	{
		if (j == shuixian(j))
			printf("%d\t", j);
		i = 1;
	}


}